﻿@page
@model AdminUI.Pages.Mall.GoodsDetailsModel
@{
    var F = Html.F();
}

@section body{
    

    <f:TabStrip ID="TabStrip1" IsFluid="true" ShowBorder="false" TabPosition="Top" EnableTabCloseMenu="false" ActiveTabIndex="0">
        <Tabs>
            <f:Tab Title="基本信息" BodyPadding="10" Layout="Fit">
                <Items>
                    <f:Form ID="Form1" ShowBorder="false" ShowHeader="false" AutoScroll="true" BodyPadding="15" >
                        <Rows>
                            <f:FormRow ColumnWidths="100%">
                                <Items>
                                    <f:TextBox ID="GoodsID" Label="商品信息" Text="@($"{Model.Current.GoodsID}-{Model.Current.GoodsName}")" Readonly="true"></f:TextBox>
                                    
                                </Items>
                            </f:FormRow>
                            <f:FormRow ColumnWidths="100%">
                                <Items>
                                    <f:TextBox ID="ImageUrl" Label="商品主图" Text="@Model.Current.ImageUrl" Readonly="true"></f:TextBox>
                                </Items>
                            </f:FormRow>
                            <f:FormRow ColumnWidths="50% 50%">
                                <Items>
                                    <f:TextBox ID="CategoryID" Label="商品类别" Text="@($"{Model.Current.CategoryID}-{Model.Current.CategoryName}")" Readonly="true"></f:TextBox>
                                    <f:RadioButtonList ID="Status" Label="状态" SelectedValue="@Model.Current.Status" Readonly="true">
                                        <f:RadioItem Text="待售" Value="0" />
                                        <f:RadioItem Text="在售" Value="1" />
                                        <f:RadioItem Text="下架" Value="2" />
                                    </f:RadioButtonList>
                                </Items>
                            </f:FormRow>
                            <f:FormRow ColumnWidths="50% 50%">
                                <Items>
                                    <f:NumberBox ID="CostPrice" Label="成本价" Readonly="true" Text="@Model.Current.CostPrice" MaxValue="999999" MinValue="0" NoDecimal="false" ShowTrigger="false"></f:NumberBox>
                                    <f:NumberBox ID="MarketPrice" Label="市场价" Readonly="true" Text="@Model.Current.MarketPrice" MaxValue="999999" MinValue="0" NoDecimal="false" ShowTrigger="false"></f:NumberBox>
                                </Items>
                            </f:FormRow>
                            <f:FormRow ColumnWidths="50% 50%">
                                <Items>
                                    <f:CheckBox ID="IsSpecial" Label="特价设置" Text="特价商品" Checked="@Model.Current.IsSpecial" Readonly="true"></f:CheckBox>
                                    @* <f:RadioButtonList ID="IsSpecial" Label="特价设置" SelectedValue="@Model.Current.IsSpecial ? 1 : 0" Readonly="true">
                                        <f:RadioItem Text="不设置" Value="0" />
                                        <f:RadioItem Text="设置各级别价格和业绩提成" Value="1" />
                                    </f:RadioButtonList> *@
                                    <f:NumberBox ID="SortFlag" Label="排序" EmptyText="" Text="@Model.Current.SortFlag" MinValue="0" ShowTrigger="true"></f:NumberBox>
                                </Items>
                            </f:FormRow>
                            <f:FormRow ColumnWidths="50% 50%">
                                <Items>
                                    <f:NumberBox ID="MAPrice" Label="A级会员价" MaxValue="999999" Text="@Model.Current.MAPrice" MinValue="0" NoDecimal="false" ShowTrigger="false" Readonly="true"></f:NumberBox>
                                    <f:NumberBox ID="MBPrice" Label="B级会员价" MaxValue="999999" Text="@Model.Current.MBPrice" MinValue="0" NoDecimal="false" ShowTrigger="false" Readonly="true"></f:NumberBox>
                                </Items>
                            </f:FormRow>
                            <f:FormRow ColumnWidths="50% 50%">
                                <Items>
                                    <f:NumberBox ID="MCPrice" Label="C级会员价" MaxValue="999999" Text="@Model.Current.MCPrice" MinValue="0" NoDecimal="false" ShowTrigger="false" Readonly="true"></f:NumberBox>
                                    <f:NumberBox ID="Commission" Label="业绩提成" MaxValue="999999" Text="@Model.Current.Commission" MinValue="0" NoDecimal="false" ShowTrigger="false" Readonly="true"></f:NumberBox>
                                </Items>
                            </f:FormRow>
                        </Rows>
                    </f:Form>

                </Items>
            </f:Tab>
            <f:Tab Title="商品相册" BodyPadding="10">
                <Items>
                    <f:Panel ShowHeader="false" Title="商品相册" BodyPadding="5" ShowBorder="false">
                        <Content class="zoomImgBox">
                            <div class="zoomImgBox">
                                <img width="180" height="180" class="zoomImg" data-caption="商品主图" src="@Model.Current.ImageUrl" />
                                @{
                                    if (Model.Current.AlbumList.Count > 1) //去掉包括主图的
                                    {
                                        foreach (var album in Model.Current.AlbumList)
                                        {
                                            <img width="180" height="180" class="zoomImg" data-caption="@album.Memo" src="@album.ImageUrl" />
                                        }
                                    }
                                }
                            </div>
                        </Content>
                    </f:Panel>
                </Items>
            </f:Tab>
        </Tabs>
    </f:TabStrip>

}

@section head{
    <link type="text/css" rel="stylesheet" href="~/res/third-party/jquerypreviewImg/preview.css" />
}

@section script {
    <script src="~/res/third-party/jquerypreviewImg/preview.js"></script>
    <script src="~/res/js/grid.js"></script>
    <script>
        showZoomImg('.zoomImg', 'img');


        // //图片预览
        // function renderImage(value, params) {
        //     //return '<a href="javascript:;" class="imagePreview">预览</a>'; //文字链接
        //     //return '<a href="javascript:;" title="预览图片" class="imagePreview"><i class="f-icon f-icon-image f-grid-cell-iconfont"></i></a>';//图片字体按钮
        //     return '<a href="javascript:;" class="imageShow"><img style="width:80px;margin:0,auto;" src="' + value + '"></a>';//自定义图片按钮
        // }

        // F.ready(function () {
        //     var grid = F.ui.Grid1;

        //     //注册图片预览单击事件
        //     grid.el.on('click', 'table a.imageShow', function (event) {
        //         var rowEl = $(this).closest('.f-grid-row');
        //         var rowData = grid.getRowData(rowEl);

        //         var path = "/Dialog/ImagePreview?url=" + rowData.values.ImageUrl;
        //         F.ui.Window1.show(path, '图片预览', 800, 800);
        //     });

        // });

    </script>
}